package cn.itcast.collection

/**
  * @Package cn.itcast.collection
  * @author KTL
  * @date 2021/5/15 0015 15:23
  * @version V1.0
  * @Copyright © 2015-04-29  One for each, and two for each
  *           Desc 演示scala中List中基本使用-
  */
object Demo05_Map {
  def main(args: Array[String]): Unit = {
    /**
      * 不可变
      */
   val name =Map("name"->"jackma","age"->18,"address"->"杭州")
   val name1=Map((name,"jackma"),("age",20))
    println(name.get("name"))
    println(name1)

    /**
      * 可变
      */
    import scala.collection.mutable.Map
    val map3 = Map("name" -> "jack", "age" -> 20, "sex" -> "男")
    map3+=("comany"->"阿里巴巴")

  }
}
